#pragma once
#include "EpilFunctionObject.h"
#include "EpilChunkCode.h"


class EpilScriptFunctionObject : public EpilFunctionObject
{
public:
	EpilScriptFunctionObject( EpilInterpreter * interpreter, const list<tstring> & parameters, const EpilChunkCode * block, bool hasVariousParameters = false );
	virtual ~EpilScriptFunctionObject();

	list<tstring> &						GetParameters()									{ return m_parameters; }
	const list<tstring> &				GetParameters() const							{ return m_parameters; }
	bool								HasVariousParameters() const					{ return m_hasVariousParameters; }
	const EpilChunkCode *				GetBlock() const								{ return m_block; }

	bool								operator==( const EpilObject & rhs ) const;

	virtual EpilFunctionType			GetFunctionType() const							{ return EFT_Script; }

	virtual tstring						ToString() const;
	virtual EpilObjectVector			Invoke( const EpilObjectVector & params ) const;

private:
	list<tstring>						m_parameters;
	bool								m_hasVariousParameters;
	const EpilChunkCode *				m_block;
};